<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="author" content="lcx">
    <script src="jquery-3.1.1.js"></script>
    <title>弹窗</title>
    <style>
        html,
        body {
            height: 100%;
            background-color: lightblue;
        }
        
        footer {
            width: 100%;
            height: 50px;
            background-color: white;
            position: fixed;
            text-align: center;
            bottom: 0px;
            margin-top: 50px;
        }
        
        footer button {
            width: 120px;
            height: 50px;
            line-height: 50px;
            background-color: #666;
        }
        
        #box {
            width: 400px;
            height: 200px;
            background-color: white;
            top: calc(50% - 100px);
            left: calc(50% - 200px);
            text-align: center;
            z-index: 2000;
            display: none;
            position: absolute;
        }
        
        #box .header_a {
            width: 400px;
            height: 40px;
            line-height: 40px;
            background-color: #ccc;
            text-align: center;
        }
        
        #box .header_a span {
            width: 20px;
            height: 20px;
            text-align: center;
            margin: 10px;
            float: right;
            font-size: 20px;
            line-height: 20px;
            cursor: pointer;
        }
        
        #box .header_b {
            margin: 10px;
        }
        
        #box input {
            width: 200px;
            height: 30px;
            padding-left: 10px;
            color: #999;
        }
        
        #box button {
            width: 240px;
            height: 30px;
            background-color: #999;
            text-align: center;
            border: none;
            line-height: 30px;
            margin-top: 10px;
            cursor: pointer;
        }
        
        #overplay {
            /*遮罩层的宽高都是100%*/
            height: 100%;
            width: 100%;
            position: absolute;
            top: 0;
            left: 0;
            background-color: rgba(0, 0, 0, 0.1);
            z-index: 999;
            display: none;
        }
    </style>
</head>

<body>
    <div id="overplay"></div>
    <div id="box">
        <div class="header_a">用户登录<span class="closebtn">×</span></div>
        <div class="header_b">账号：<input type="text" placeholder="请输入用户名"></div>
        <div class="header_c">密码：<input type="text" placeholder="请输入密码"></div>
        <button>登录</button>
    </div>

    <footer><button>来点我呀</button></footer>
</body>

</html>
<script>
    $('footer button').click(function () {
        $('#box').show();
        $('#overplay').show();
    })
    $('#box .closebtn').click(function () {
        $('#box').hide();
    })
    $('#box').drag(function () {

    })

</script>